/*
 * Copyright (C) 2021 Huawei Device Co., Ltd.
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.freddy.chat.ohos;

import ohos.eventhandler.EventHandler;
import ohos.eventhandler.EventRunner;

/**
 * Handler
 *
 * @since 2021-04-13
 */
public class Handler extends EventHandler {
    /**
     * 构造方法
     *
     * @param runner EventRunner
     * @throws IllegalArgumentException 异常
     */
    public Handler(EventRunner runner) throws IllegalArgumentException {
        super(runner);
    }

    /**
     * post
     *
     * @param runnable Runnable
     */
    public final void post(Runnable runnable) {
        super.postTask(runnable);
    }

    /**
     * postDelayed
     *
     * @param runnable    Runnable
     * @param delayMillis 延迟时间
     */
    public final void postDelayed(Runnable runnable, long delayMillis) {
        super.postTask(runnable, delayMillis);
    }

    /**
     * removeCallbacks
     *
     * @param runnable Runnable
     */
    public final void removeCallbacks(Runnable runnable) {
        super.removeTask(runnable);
    }
}
